/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package mbos.entities;

import mbos.entities.enums.OrderType;
import java.io.Serializable;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.EnumType;
import javax.persistence.Enumerated;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToOne;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;

/**
 *
 * @author mier
 */
@Entity
@Table(name="order_details")
public class OrderDetails implements Serializable{
  public static final long serialVersionUID = 1l;
  @Id
  @GeneratedValue(strategy = GenerationType.IDENTITY)
  private Integer id;
  @JoinColumn(name="item_id", referencedColumnName = "id")
  @OneToOne(optional = false)
  private Item itemId;
  @JoinColumn(name="order_id", referencedColumnName = "id")
  @ManyToOne
  private Orders orderId;
  @NotNull
  @Column(name="qty_ordered")
  private int qtyOrdered;
  @NotNull
  @Enumerated(EnumType.STRING)
  @Column(name="order_type")
  private OrderType orderType;
  @NotNull
  @Column(name="amount")
  private double amount;
  @Column(name="dflg")
  private short dflg;

  public Integer getId() {
    return id;
  }

  public void setId(Integer id) {
    this.id = id;
  }

  public Item getItemId() {
    return itemId;
  }

  public void setItemId(Item itemId) {
    this.itemId = itemId;
  }

  public Orders getOrderId() {
    return orderId;
  }

  public void setOrderId(Orders orderId) {
    this.orderId = orderId;
  }

  public int getQtyOrdered() {
    return qtyOrdered;
  }

  public void setQtyOrdered(int qtyOrdered) {
    this.qtyOrdered = qtyOrdered;
  }

  public OrderType getOrderType() {
    return orderType;
  }

  public void setOrderType(OrderType orderType) {
    this.orderType = orderType;
  }

  public double getAmount() {
    return amount;
  }

  public void setAmount(double amount) {
    this.amount = amount;
  }

  public short getDflg() {
    return dflg;
  }

  public void setDflg(short dflg) {
    this.dflg = dflg;
  }
  
  
  
}
